package com.example.grafstock_upload;

import java.util.List;

import org.csi.controle.core.entidade.EnvioFoto;
import org.csi.controle.upload.listener.RetornoEnvioOs;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Window;
import android.widget.GridView;

public class ListaOsActivity extends Activity {

	private ProgressDialog dialog;

	private OsAdapter osAdapter;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.grid_os);
		dialog = ProgressDialog.show(ListaOsActivity.this, "", "Aguarde, carregando envios...", true);
		ServicoAndroid<List<EnvioFoto>> sa = new ServicoAndroid<List<EnvioFoto>>(new RetornoEnvioOs(this));
		osAdapter = new OsAdapter(this);
		GridView gridview = (GridView) findViewById(R.id.gridviewos);
		gridview.setAdapter(osAdapter);
		String[] params = new String[] {ServicoAndroid.TIPO_ENVIO_FOTO};
		sa.execute(params);
	}

	public OsAdapter getOsAdapter() {
		return osAdapter;
	}

	public ProgressDialog getDialog() {
		return dialog;
	}
	
}